varying vec3 pos,l,n,v,h;
varying vec2 texCoord;
varying bool reverse;
uniform vec3 eyePos;
uniform vec3 lightPos;
varying vec4 posit;

void main(void) {
    gl_Position = ftransform();
    vec4 trans = gl_TextureMatrix[3]*gl_Vertex;
    posit = trans;
    gl_ClipVertex = gl_ModelViewMatrix*gl_Vertex;
    pos = gl_Vertex.xyz;
    texCoord = gl_MultiTexCoord0.xy;
    l = normalize(lightPos - pos);
    n = normalize(gl_NormalMatrix * gl_Normal).xyz;
    v = normalize(eyePos - pos);
    if(dot(n,v) < 0) reverse = true;
    else reverse = false;
    h = normalize(l + v);
}